<template>
	<view>
		<!-- 热门搜索 -->
		<card headTitle="热门搜索" bodyCover="../../static/images/demo/demo8.jpg"></card>
		<!-- 多色按钮组件 -->
		<view class="px-1 mb-2">
			<colorTag :item="item" v-for="(item,index) in hot" :key="index"></colorTag>
		</view>
		<!-- 常用分类 -->
		<card headTitle="常用分类" :headerBorderBottom="false" :bodyPadding="true">
				<colorTag v-for="(item,index) in cate" :key="index" :item="item" :isColor="false"></colorTag>
		</card>
		<!-- 分割线 -->
		<divider/>
		<!-- 搜索记录 -->
		<card headTitle="搜索记录">
			<uni-list-item title="小米" ></uni-list-item>
		</card>
	</view>
</template>

<script>
	import card from '@/components/common/card.vue'
	import colorTag from '@/components/search/color-tag.vue'
	import  uniListItem from '@/components/uni-ui/uni-list-item/uni-list-item.vue'
	export default {
		components: {
			card,
			colorTag,
			uniListItem
		},
		data() {
			return {
				hot: [{
						name: '领劵中心'
					},
					{
						name: 'Redmi K20'
					},
					{
						name: 'xiaomi14 ProMax'
					},
					{
						name: '智能积木 越野四区车'
					},
					{
						name: '手环 腕带'
					},
					{
						name: 'Redmi Book 14'
					}
				],
				cate: [{
						name: '耳机'
					},
					{
						name: '手机'
					},
					{
						name: '音响'
					},
					{
						name: '手表'
					},
					{
						name: '配件'
					},
					{
						name: '网关/传感器'
					},
					{
						name: '健康'
					},
					{
						name: '酷玩'
					}
				]
			}
		},
		onNavigationBarSearchInputConfirmed(e) {
			uni.navigateTo({
				url:'../search-list/search-list'
			})
		},
		onNavigationBarButtonTap(e) {
			if(e.index === 0) {
				uni.navigateTo({
					url:'../search-list/search-list'
				})
			}
		},
		methods: {

		}
	}
</script>

<style>

</style>